package me.ree.zkproduct.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MyEventPublisher {

    private final ApplicationEventPublisher publisher;


    public MyEventPublisher(ApplicationEventPublisher publisher) {
        this.publisher = publisher;
    }

    public void publishMyEvent(String message) {
        log.info("MyEventPublisher publishMyEvent begin...");
        publisher.publishEvent(new MyEvent(this, message));
    }
}
